home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / ilisp / ilisp-hlw.el.z / ilisp-hlw.el
Encoding:
Text File  |  1998-05-21  |  2.7 KB  |  79 lines

  1. ;;; -*- Mode: Emacs-Lisp -*-
  2.  
  3. ;;; ilisp-hlw.el --
  4.  
  5. ;;; This file is part of ILISP.
  6. ;;; Version: 5.8
  7. ;;;
  8. ;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
  9. ;;;               1993, 1994 Ivan Vasquez
  10. ;;;               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
  11. ;;;               1996 Marco Antoniotti and Rick Campbell
  12. ;;;
  13. ;;; Other authors' names for which this Copyright notice also holds
  14. ;;; may appear later in this file.
  15. ;;;
  16. ;;; Send mail to 'ilisp-request@naggum.no' to be included in the
  17. ;;; ILISP mailing list. 'ilisp@naggum.no' is the general ILISP
  18. ;;; mailing list were bugs and improvements are discussed.
  19. ;;;
  20. ;;; ILISP is freely redistributable under the terms found in the file
  21. ;;; COPYING.
  22.  
  23.  
  24. ;;;
  25. ;;; ILISP LispWorks Common Lisp dialect definition
  26. ;;;
  27. ;;; Independently written by:
  28. ;;;
  29. ;;; Jason Trenouth: jason@harlequin.co.uk
  30. ;;; Qiegang Long: qlong@cs.umass.edu
  31. ;;;
  32. ;;; and later merged together by Jason
  33. ;;;
  34.  
  35. (defvar ilisp-lispworks-init-file "lispworks.lisp")
  36.  
  37. ;; may use Qiegang's instead? "[-A-Z]+ [0-9]+ : \\([0-9]+\\) >"
  38.  
  39. (defun lispworks-break-level (prompt)
  40.   (let ((position nil))
  41.     (if (and prompt (setq position (string-match ": [0-9]+" prompt)))
  42.     (string-to-int (substring prompt (+ 2 position)))
  43.       0)))
  44.  
  45. (defun lispworks-check-prompt (old new)
  46.   "Compare the break level printed at the beginning of the prompt."
  47.   (<= (lispworks-break-level new) (lispworks-break-level old)))
  48.  
  49. ;; Qiegang's prompt matcher "^\\([-A-Z]+ [0-9]+ >\\)\\|\\([-A-Z]+ [0-9]+ : [0-9]+ >\\) "
  50. ;; Qiegang's error matcher "\\(ILISP:[^\"]*\\)\\|\\(Error: [^\n]*\\)\\|\\(Break.[^\n]*\\)"
  51.  
  52. (defdialect lispworks "LispWorks"
  53.   clisp
  54.   (ilisp-load-init 'lispworks ilisp-lispworks-init-file)
  55.   (setq comint-fix-error ":a"
  56.     ilisp-reset ":a" ;; LW doesn't have a multi-level abort yet
  57.     comint-continue ":c"
  58.     comint-interrupt-regexp  "Break.\n.*")
  59.   (setq comint-prompt-status 
  60.     (function (lambda (old line)
  61.       (comint-prompt-status old line 'lispworks-check-prompt))))
  62.   ;; <cl> or package> at top-level
  63.   ;; [0-9c] <cl> or package> in error
  64.   ;; (setq comint-prompt-regexp "^\\(\\[[0-9]*c*\\] \\|\\)\\(<\\|\\)[^>]*> ")
  65.   (setq comint-prompt-regexp "^[A-Z=][-a-z0-9A-Z:= ]*[$%#>]+ *") 
  66.   (setq ilisp-error-regexp "ILISP [0-9]* : [0-9]* > ")
  67.   (setq ilisp-binary-command "system::*binary-file-type*")
  68.   (setq ilisp-source-types (append ilisp-source-types '(("any"))))
  69.   (setq ilisp-directory-command "(lw:current-pathname)")
  70.   (setq ilisp-set-directory-command "(lw:change-directory \"%s\")")
  71.   (setq ilisp-find-source-command 
  72.     "(ILISP:ilisp-source-files \"%s\" \"%s\" \"%s\")")
  73.   (setq ilisp-init-binary-command 
  74.     "system::*binary-file-type*"))
  75.   
  76. (if (not lispworks-program) (setq lispworks-program "lispworks"))
  77.  
  78. (provide 'ilisp-lw)
  79.